
const { ccclass, menu } = cc._decorator;

@ccclass
@menu('common/GCBlock')
export default class GCBlock extends cc.Component {

    public static block() {
        const node = cc.find('Block');
        if (!node) {
            console.error('No Block Found');
            return;
        }

        node.active = true;
    }

    public static unblock() {
        cc.log('unblock');
        const node = cc.find('Block');
        if (!node) {
            console.error('No Block Found');
            return;
        }

        node.active = false;
    }

    protected onLoad(): void {
        cc.game.addPersistRootNode(this.node);
        this.node.active = false;
    }
}

if (CC_DEBUG) {
    (window as any).GCBlock = GCBlock;
}
